package com.github.thinwonton.springboot.showcase.webservice.config;

import com.github.thinwonton.springboot.showcase.webservice.ws.CountService;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.xml.ws.Endpoint;

/**
 * web service配置
 *
 * @author hugo
 * @date 2018/8/16
 */
@Configuration
public class WSConfig {

    @Bean
    public Endpoint endpoint(Bus bus, CountService countService) {
        Endpoint endpoint = new EndpointImpl(bus, countService);
        endpoint.publish("/CountService");//接口发布在 /CountService 目录下
        return endpoint;
    }

}
